package com.bldby.baselibrary.core.upfile;

import com.alibaba.fastjson.TypeReference;
import com.bldby.baselibrary.core.network.BaseApiRequest;
import com.bldby.baselibrary.core.network.ParamsBuilder;
import com.bldby.baselibrary.core.network.RequestLevel;

import java.io.File;
import java.util.List;

/**
 * package name: com.bldby.baselibrary.core
 * user: yangqinbo
 * date: 2020/6/29
 * time: 18:15
 * email: 694125155@qq.com
 */
/*
 * 文件上传
 * */
public class UpFilesRequest extends BaseApiRequest {
    public List<File> fileList;
    public String filedir;

    @Override
    public String getAPIBaseURL() {
        return null;
    }

    @Override
    public String getAPIName() {
        return "files/upload";
    }

    @Override
    public RequestLevel getRequestLevel() {
        return RequestLevel.POST;
    }

    @Override
    public TypeReference getResponseType() {
        return null;
    }

    @Override
    public ParamsBuilder appendParams(ParamsBuilder builder) {
        return builder.append("files", fileList).append("filedir", filedir);
    }

    @Override
    public TypeReference getDatatype() {
        return new TypeReference<FileModel>() {
        };
    }
}